﻿namespace Probel.PersonalNotes.Controllers
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.Mvc;

    using Probel.PersonalNotes.Models;
    using Probel.PersonalNotes.Models.Home;

    public class HomeController : Controller
    {
        #region Fields

        private readonly RecordManager Manager = new RecordManager();

        #endregion Fields

        #region Methods

        public ActionResult About()
        {
            ViewBag.Message = "A propos...";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Page de contacts.";

            return View();
        }

        public ActionResult Index(RecordViewModel model)
        {
            return View(model);
        }

        [HttpPost]
        public ActionResult Record(RecordViewModel model)
        {
            this.Manager.Insert(model);
            return View(model);
        }

        #endregion Methods
    }
}